import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';
import nodejs from '@dfeidao/atom-web/msg/nodejs';
import refresh from '@dfeidao/atom-web/url/refresh';
export default async function a003(fd: IFeidaoAiBrowserComponent) {
	// todo
	//保存

	const name = fd.data.node.querySelector<HTMLInputElement>('[data-id="NameId"]').value;
	if (!name) {
		alert("请输入要保存计划分类属性名称")
		return;
	} else {
		const r = await nodejs<{ code: 0 | 1 }>('liuxinyu/zj-000002/s001', {
			filter: {
				plan_cla_attr_no: '',
				plan_cla_attr_name: name,
			}
		})
		console.log(r);
		if (r.code === 1) {
			alert("保存成功")
			refresh();
		}

	}
}
